package com.lh.aop;

import org.springframework.stereotype.Component;

/**
 *  前置通知(before)==>目标方法==>返回通知(AfterReturning)==>后置通知(After)
 *  前置通知(before)==>目标方法==>异常通知(AfterThrowing)==>后置通知(After)
 *
 */
//业务类
@Component
public class HelloService {

    public HelloService(){
        System.out.println("....");
    }

    public String sayHello(String name){
        String result = "你好："+name;
        System.out.println(result);
        int length = name.length();
        return result + "---" + length;
    }
}